﻿@model HCQ2_Model.T_DocumentFolder
@{
    ViewBag.Title = "云端素材";
}
@section headerSection{
    <link href="~/Resources/mainFrame/js/plugins/zTree3/css/demo.css" rel="stylesheet" />
    <link href="~/Resources/mainFrame/js/plugins/zTree3/css/metroStyle/metroStyle.css" rel="stylesheet" />
    <script src="~/Resources/mainFrame/js/plugins/zTree3/js/jquery.ztree.core.min.js"></script>
    <script src="~/Resources/mainFrame/js/plugins/zTree3/js/jquery.ztree.excheck.min.js"></script>
    <script src="~/Resources/mainFrame/js/plugins/zTree3/js/jquery.ztree.exedit.min.js"></script>
    <script src="~/Resources/tools/search_zTree.js"></script>
    <script src="~/Resources/tools/HRHelp.js"></script>
    <style>
        body {
            font-family: '微软雅黑';
            font-size: 14px;
            color: #676a6c;
        }

        a {
            font-size: 15px;
        }

        .float-unit {
            height: 100%;
            border: 1px solid #E7EAEC;
            border-top-width: 0px;
            border-bottom-width: 0px;
            margin-bottom: 0px;
        }

        .left-sm-3 {
            padding-left: 0px;
        }

        .right-sm-9 {
            padding-right: 0px;
        }

        .ibox-unit {
            overflow-y: auto;
            height: 89%;
            padding: 0px;
        }

        #exampleToolbar div {
            margin-bottom: 0px;
        }

        #exampleToolbar > .form-group {
            float: left;
            margin: 0;
            margin-right: 5px;
            margin-top: 1px;
        }

        .form-group > button {
            margin-top: -2px;
            margin-bottom: 2px;
        }

        #unitTreezTreeData {
            border: 0;
            border-top: 1px solid #E7EAEC;
            background: #FFFFFF;
        }

            #unitTreezTreeData li {
                line-height: 28px;
            }

                #unitTreezTreeData li:hover {
                    background: #F5F5F5;
                }

        #search_condition {
            width: 99%;
        }

        .selectTreezTreeLI {
            background-color: #2DC1C3;
            color: #fff;
        }

        #nodeFormTable label {
            font-weight: bold;
        }

        .fileClass label {
            text-align: right;
        }

        #upFileForm .col-sm-7 {
            margin-bottom: 8px;
        }

        #bootstrap-duallistbox-selected-list_duallistbox_demo1 option, bootstrap-duallistbox-nonselected-list_duallistbox_demo1 option {
            height: 30px;
            line-height: 30px;
            padding-top: 5px;
        }

            #bootstrap-duallistbox-selected-list_duallistbox_demo1 option:hover, bootstrap-duallistbox-nonselected-list_duallistbox_demo1 option:hover {
                background-color: antiquewhite;
            }

        .buttons {
            width: 100%;
        }

            .buttons button {
                width: 50%;
            }
            #folderTree {
            width: 350px;
            height: 300px;
            padding: 0;
            border: 1px solid #E7EAEC;
            background-color: #FFFFFF;
            position: fixed;
            z-index: 9;
            overflow: auto;
            display: none;
        }
         #BatchEditFile .form-group{height:25px;}
    </style>
}
<div class="wrapper animated fadeInRight autoHeight">
    <!-- Panel Other -->
    <div class="row autoHeight" style="background-color: #fff;">
        <!--选择类别-->
        <div id="unitTree" class="col-sm-3" style="width:220px;height:100%;padding:0;border:1px solid #E7EAEC;">
            @{
                List<string> folderList = (List<string>)ViewBag.elementList;
                if (folderList.Contains("docAddPeer"))
                {
                    <button id="docAddPeer" type="button" title="添加根节点" class="btn btn-outline btn-primary">
                        <i class="glyphicon glyphicon-list" aria-hidden="true"></i>
                    </button>
                }
                if (folderList.Contains("docAddSysPeer"))
                {
                    <button id="docAddSysPeer" type="button" title="添加系统根节点" class="btn btn-outline btn-primary">
                        <i class="glyphicon glyphicon-list" aria-hidden="true"></i>
                    </button>
                }
                if (folderList.Contains("docAddChild"))
                {
                    <button id="docAddChild" type="button" title="添加子节点" class="btn btn-outline btn-primary">
                        <i class="glyphicon glyphicon-list-alt" aria-hidden="true"></i>
                    </button>
                }
                if (folderList.Contains("docAddSysChild"))
                {
                    <button id="docAddSysChild" type="button" title="添加系统子节点" class="btn btn-outline btn-primary">
                        <i class="glyphicon glyphicon-list-alt" aria-hidden="true"></i>
                    </button>
                }
                if (folderList.Contains("docEdit"))
                {
                    <button id="docEdit" type="button" title="编辑节点" class="btn btn-outline btn-primary">
                        <i class="glyphicon glyphicon-edit" aria-hidden="true"></i>
                    </button>
                }
                if (folderList.Contains("docSysEdit"))
                {
                    <button id="docSysEdit" type="button" title="编辑系统节点" class="btn btn-outline btn-primary">
                        <i class="glyphicon glyphicon-edit" aria-hidden="true"></i>
                    </button>
                }
                if (folderList.Contains("docHeader"))
                {
                    <button id="docHeader" type="button" title="节点图标" class="btn btn-outline btn-primary">
                        <i class="glyphicon glyphicon-picture" aria-hidden="true"></i>
                    </button>
                }
                if (folderList.Contains("docDel"))
                {
                    <button id="docDel" type="button" title="删除节点" class="btn btn-outline btn-danger">
                        <i class="glyphicon glyphicon-trash" aria-hidden="true"></i>
                    </button>
                }
            }
        </div>
        <div class="col-sm-9 col-sm-leftRight" style="width: calc(100% - 220px);padding-left: 3px; margin-top: 2px;">
            <!-- Example Toolbar -->
            <div class="example">
                <div class="btn-group hidden-xs" id="exampleToolbar" role="group">
                    <div class="form-group form-inline" style="width:100%;">
                        @{
                            if (folderList.Contains("btnEditFile"))
                            {
                                <div class="form-group">
                                    <button id="btnEditFile" class="btn btn-primary" type="button"><i class="fa fa-pencil"></i>&nbsp;编辑</button>
                                </div>
                            }
                            if (folderList.Contains("btnFileList"))
                            {
                                <div class="form-group">
                                    <button id="btnFileList" class="btn btn-primary" type="button"><i class="fa fa-pencil"></i>&nbsp;附件列表</button>
                                </div>
                            }
                            if (folderList.Contains("btnDeleteFile"))
                            {
                                <div class="form-group">
                                    <button id="btnDeleteFile" class="btn btn-danger" type="button"><i class="fa fa-trash"></i>&nbsp;下架</button>
                                </div>
                            }
                            if (folderList.Contains("btnRecommendFile"))
                            {
                                <div class="form-group">
                                    <button id="btnRecommendFile" class="btn btn-primary" type="button"><i class="fa fa-fire"></i>&nbsp;推荐商品</button>
                                </div>
                            }
                            if (folderList.Contains("btnNotRecommendFile"))
                            {
                                <div class="form-group">
                                    <button id="btnNotRecommendFile" class="btn btn-warning" type="button"><i class="fa fa-fire"></i>&nbsp;取消推荐</button>
                                </div>
                            }
                            if (folderList.Contains("btnPayFileUser"))
                            {
                                <div class="form-group">
                                    <button id="btnPayFileUser" class="btn btn-primary" type="button"><i class="fa fa-fire"></i>&nbsp;购买用户设置</button>
                                </div>
                            }
                            if (folderList.Contains("btnBatch"))
                            {
                                <div class="form-group">
                                    <button id="btnBatch" class="btn btn-primary" type="button"><i class="glyphicon glyphicon-list"></i>&nbsp;批量编辑</button>
                                </div>
                            }
                        }
                    </div>
                    <div class="form-group form-inline" style="width:100%;">
                        @{
                            if (folderList.Contains("btnSearch"))
                            {
                            <div class="form-group" style="width:160px;margin-top:-2px;">
                                <input id="keyword" name="keyword" type="text" class="form-control" placeholder="名称/作者/代码">
                            </div>
                            <div class="form-group" style="width:150px;margin-top:-9px;margin-left:15px;" title="是否包含子目录">
                                <select id="inChild" class="form-control input-sm selectpicker" data-live-search="true" style="padding: 5px 10px;">
                                    <option value="no" selected>不包含子目录</option>
                                    <option value="yes">包含子目录</option>
                                </select>
                            </div>
                            <div class="form-group" style="width:140px;margin-top:-9px;">
                                <select id="file_classify" title="适合分类" class="form-control input-sm selectpicker" placeholder="适合分类"></select>
                            </div>
                            <div class="form-group" style="width:120px;margin-top:-9px;">
                                <select id="sourceType" title="价格" class="form-control input-sm selectpicker" placeholder="价格" style="padding: 5px 10px;">
                                    <option value="-1">全部</option>
                                    <option value="5">收费</option>
                                    <option value="3">免费</option>
                                </select>
                            </div>
                            <div class="form-group" style="width:130px;margin-top:-9px;">
                                <select id="is_recommend" title="推荐标记" class="form-control input-sm selectpicker" placeholder="推荐标记">
                                    <option value="-1">全部</option>
                                    <option value="0">未推荐</option>
                                    <option value="1">已推荐</option>
                                </select>
                            </div>
                            <div class="form-group" style="width:220px;margin-top:-9px;">
                                <select id="org_unit" title="所属单位" class="form-control input-sm selectpicker" placeholder="所属单位" style="padding: 5px 10px;">
                                    <option value="">全部</option>
                                </select>
                            </div>
                            <div class="form-group">
                                <button id="btnSearch" class="btn btn-primary" type="button"><i class="fa fa-search"></i>&nbsp;查询</button>
                            </div>
                            }
                    }
                    </div>                                          
                </div>
                <table id="exampleTableToolbar" data-mobile-responsive="true" data-radio="true" style="table-layout: fixed !important;"></table>
            </div>
            <!-- End Example Toolbar -->
        </div>
    </div>
    <!-- End Panel Other -->
</div>
<!--添加/编辑普通节点-->
<div id="EditNode" class="form-group" style="padding-top:20px;overflow: hidden; display: none;">
    <div class="form-group">
        <label class="col-sm-3 control-label">节点名称<span class="glyphicon glyphicon-asterisk requiredtitle"></span>：</label>
        <div class="col-sm-7">
            <input id="addNode" name="addNode" type="text" class="form-control input-sm" placeholder="请输入节点名称" title="请输入节点名称" required="" aria-required="true" />
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label">产品类别<span class="glyphicon glyphicon-asterisk requiredtitle"></span>：</label>
        <div class="col-sm-7">
            <select id=proType1 title="请选择产品类别" name="proType1" class="selectpicker show-tick bs-select-hidden" data-live-search="false" required="" aria-required="true" placeholder="请选择产品类别">
                <option value="1" selected>VRPPT</option>
                <option value="2">创客</option>
                <option value="3">头记</option>
                <option value="4">校史馆</option>
            </select>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label">序号：</label>
        <div class="col-sm-7">
            <input id="folder_order1" name="folder_order1" type="text" onblur="help.int('folder_order1')" class="form-control input-sm" placeholder="请输入节点序号" title="请输入节点序号" />
        </div>
    </div>
</div>
<!-- 添加/编辑系统节点 -->
<div id="nodeForm" style="overflow-x: hidden; display: none;">
    <form class="form-horizontal m-t" id="nodeFormTable" method="post">
        <div class="form-group">
            <label class="col-sm-4 control-label">节点名称<span class="glyphicon glyphicon-asterisk requiredtitle"></span>：</label>
            <div class="col-sm-6">
                <input id="name" name="name" type="text" class="form-control input-sm" placeholder="请输入节点名称" title="请输入节点名称" required="" aria-required="true" />
                <input type="hidden" id="pId" name="pId" value="" />
                <input type="hidden" id="pageType" name="pageType" value="" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-4 control-label">产品类别<span class="glyphicon glyphicon-asterisk requiredtitle"></span>：</label>
            <div class="col-sm-6">
                <select id="pro_type" title="请选择产品类别" name="pro_type" class="selectpicker show-tick bs-select-hidden" data-live-search="false" required="" aria-required="true" placeholder="请选择产品类别">
                    <option value="1" selected>VRPPT</option>
                    <option value="2">创客</option>
                    <option value="3">头记</option>
                    <option value="4">校史馆</option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-4 control-label">所属单位<span class="glyphicon glyphicon-asterisk requiredtitle"></span>：</label>
            <div class="col-sm-6">
                <select id="unit_code" title="请选择所属单位" name="unit_code" class="selectpicker show-tick bs-select-hidden" data-live-search="false" placeholder="请选择所属单位">
                    <option value="" selected>空</option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-4 control-label">分享到此目录<span class="glyphicon glyphicon-asterisk requiredtitle"></span>：</label>
            <div class="col-sm-6">
                <select id="was_share" name="was_share" title="请选择能否用于分享" class="form-control input-sm selectpicker" required="" aria-required="true" placeholder="请选择能否用于分享" style="padding: 5px 10px;">
                    <option value=false selected>不允许</option>
                    <option value=true>允许</option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-4 control-label">允许创建子目录<span class="glyphicon glyphicon-asterisk requiredtitle"></span>：</label>
            <div class="col-sm-6">
                <select id="if_create_child" name="if_create_child" title="请选择能否创建子目录" class="form-control input-sm selectpicker" required="" aria-required="true" placeholder="请选择能否创建子目录" style="padding: 5px 10px;">
                    <option value=true selected>允许</option>
                    <option value=false>不允许</option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-4 control-label">允许用户编辑<span class="glyphicon glyphicon-asterisk requiredtitle"></span>：</label>
            <div class="col-sm-6">
                <select id="read_only" name="read_only" title="请选择是否允许用户编辑" class="form-control input-sm selectpicker" required="" aria-required="true" placeholder="请选择是否允许用户编辑" style="padding: 5px 10px;">
                    <option value=false>允许</option>
                    <option value=true selected>不允许</option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-4 control-label">节点类型<span class="glyphicon glyphicon-asterisk requiredtitle"></span>：</label>
            <div class="col-sm-6">
                <select id="doc_type" name="doc_type" title="请选择节点类型" class="form-control input-sm selectpicker" required="" aria-required="true" placeholder="请选择节点类型" style="padding: 5px 10px;">
                    <option value="0" selected>我的文档</option>
                    <option value="1">我的分享</option>
                    <option value="2">分享文档</option>
                    <option value="3">公用文档</option>
                    <option value="4">回收站</option>
                    <option value="5">待审核资源</option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-4 control-label">系统节点<span class="glyphicon glyphicon-asterisk requiredtitle"></span>：</label>
            <div class="col-sm-6">
                <select id="if_sys" name="if_sys" title="请选择是否允许用户编辑" class="form-control input-sm selectpicker" required="" aria-required="true" placeholder="请选择是否允许用户编辑" style="padding: 5px 10px;">
                    <option value=false>普通节点</option>
                    <option value=true selected>系统节点</option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-4 control-label">附件后缀约束：</label>
            <div class="col-sm-6">
                <textarea class="form-control" id="rest_type" name="rest_type" rows="3" placeholder="请输入附件后缀名称约束以逗号隔开，为空表示不约束附件上传格式" title="请输入附件后缀名称约束以逗号隔开，为空表示不约束附件上传格式"></textarea>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-4 control-label">序号：</label>
            <div class="col-sm-6">
                <input id="folder_order" name="folder_order" type="text"  onblur="help.int('folder_order')" class="form-control input-sm" placeholder="请输入节点序号" title="请输入节点序号" />
            </div>
        </div>
        <p style="color:red; padding-left:20px; padding-right:20px;">温馨提示：节点类型>我的文档：内容仅自己可见，分享文档：别人分享给自己的文档，公用文档：全员可见</p>
</form>
</div>
<!--购买人设置-->
<div id="createDataBySel" style="width: 650px;overflow: hidden; display: none;">
    <div class="col-md-12">
        <select multiple="multiple" size="15" name="duallistbox_demo1" style="height: 250px;" class="demo1 listSel"></select>
    </div>
</div>
<!-- 批量编辑 -->
<div id="BatchEditFile" class="form-group" style="height:90%;padding-top:20px;overflow: hidden; display: none;" autocomplete="off">
    <div class="form-group">
        <label class="col-sm-3 control-label">目录导航<span class="glyphicon glyphicon-asterisk requiredtitle"></span>：</label>
        <div class="col-sm-8">
            <input id="folder_name" name="folder_name" type="text" required="" aria-required="true" class="form-control input-sm" placeholder="请选择目录导航" title="请选择目录导航" autocomplete="off"/>
            <div id="folderTree" class="col-sm-3"></div>
            <input id="folder_id" name="folder_id" type="hidden" />
            <input id="folder_path" name="folder_path" type="hidden" />
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label">适合分类<span class="glyphicon glyphicon-asterisk requiredtitle"></span>：</label>
        <div class="col-sm-8">
            <select id="fileClassify" name="fileClassify" title="请选择适合分类" class="form-control input-sm selectpicker" data-live-search="true" required="" aria-required="true" placeholder="请选择适合分类"></select>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label">所属单位<span class="glyphicon glyphicon-asterisk requiredtitle"></span>：</label>
        <div class="col-sm-8">
            <select id="orgUnit" name="orgUnit" title="请选择所属单位" class="form-control input-sm selectpicker" placeholder="请选择所属单位" style="padding: 5px 10px;">
                <option value="">空</option>
            </select>
        </div>
    </div>
</div>
@section footSection{
    <script src="~/Resources/x-editable/js/bootstrap-editable.js"></script>
    <script src="~/Resources/duallistbox/jquery.bootstrap-duallistbox.min.js"></script>
    <script src="~/Resources/myScript/Doc/sourceManager.js"></script>
    <script>
        var userID = "@ViewBag.userID", isDocSys = "@ViewBag.isdocManager", isApprive = "@ViewBag.isApprive";
        $(function () {
            //适合分类
            $('#file_classify').initSelectcontrol("docClassify",true);
            //所属单位
            $.ajax({
                url: ctx + '/SysCommon/GetDictionaryByCode',
                type: "post",
                cache: false,
                async: false,
                data: { fieldCode: 'SysUserUnit' },
                dataType: 'json',
                success: function (data) {
                    if (data.Statu === 1) {
                        layer.msg(data.Msg, { icon: 5 });
                        return false;
                    }
                    var itemStr = "";
                    $.each(data.Data, function (i, item) {
                        itemStr += "<option value='" + item.code_name + "'>" + item.code_name + "</option>";
                    });
                    $('#org_unit').append(itemStr);
                    $('.selectpicker').selectpicker({ size: 6 });
                    $('.selectpicker').selectpicker('refresh');
                },
                error: function () {
                    layer.msg('数据异常~', { icon: 5 });
                }
            });
            //初始化页面
            docManager.initPage(userID, isDocSys);
        });
    </script>
}